import React from 'react';


// 创建上下文环境
let react = React as any;
if(react.context === undefined){
    react.context = new Array();
} 

export default interface Widget{
    Print: React.ReactNode,
    Markdown: React.ReactNode,
    PowerPoint: React.ReactNode
}

/**
 * 获取组件全局属性
 * @param name 属性名
 * @returns 属性值
 */
export function getAttribute(name:string){
    return react.context[name];
}

/**
 * 设置组件全局属性
 * @param name 属性名
 * @param value 属性值
 */
export function setAttribute(name:string, value:any){
    react.context[name] = value
}